package com.kuaimacode.kframework.admin.controller.user;

import com.kuaimacode.kframework.admin.services.user.UserAccountDetailService;
import com.kuaimacode.kframework.admin.vo.response.UserAccountDetailVO;
import com.kuaimacode.kframework.constants.PageConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author qinyong
 * @Title:
 * @Package com.kuaimacode.kframework.admin.controller.user
 * @Description: created by IntelliJ IDEA
 * @date 2019-05-25 21:40
 */
@Controller
@RequestMapping("userRecharge")
public class UserRechargeController {

    private static String PAGE_FILE_NAME = "userWithdrawal/";

    @Autowired
    private UserAccountDetailService accountDetailService;

    @GetMapping("/index")
    public String recharge(
            @RequestParam(value = "pageNum", defaultValue = PageConstants.PAGE_NUM + "") int pageNum,
            @RequestParam(value = "pageSize", defaultValue = PageConstants.PAGE_SIZE + "") int pageSize,
            UserAccountDetailVO searchVO, ModelMap model) {
        model.put("pageInfo", accountDetailService.findUserRechargeDetailList(searchVO, pageNum, pageSize));
        model.put("searchVO", searchVO);
        return PAGE_FILE_NAME + "accountRecharge";
    }
}
